package org.jeecg.modules.lock.util;

import java.math.BigInteger;
import java.security.MessageDigest;

/**
 * Created by IntelliJ IDEA
 *
 * @Description:
 * @Author : M-JGG
 * @create 2024/4/3 15:42
 */
public class PasswordTempUtil {

    public static String md5(String input) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] messageDigest = md.digest(input.getBytes());
            BigInteger no = new BigInteger(1, messageDigest);
            String hashtext = no.toString(16);
            while (hashtext.length() < 32) {
                hashtext = "0" + hashtext;
            }
            return hashtext;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
